package com.tmsps.common.config.prop;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.util.Map;

/**
 * @ClassName ExceptionCode
 * @description TODO
 * @author geek
 */
@Configuration
@ConfigurationProperties("result")
@PropertySource(value = "classpath:config/error-code.properties", encoding = "UTF-8")
public class ExceptionCode {

    private Map<String, String> codes = null;

    public java.util.Map<String, String> getCodes() {
        return codes;
    }

    public void setCodes(Map<String, String> codes) {
        this.codes = codes;
    }

    public String getMessage(String code){
        return codes.get(code);
    }

}
